package com.example.demo.huawei;

import java.util.Arrays;
import java.util.Scanner;

public class Main47 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] split = line.split("\\s");

        int[] arr = new int[split.length * 2];
        for (int i = 0; i < split.length; i++) {
            arr[i] = Integer.parseInt(split[i]);
        }
        for (int i = 0; i < split.length; i++) {
            arr[i + split.length] = Integer.parseInt(split[i]);
        }
        // 3 15 6 14 3 15 6 14
        //        输出：3 21 9 17
        for (int i = 0; i < arr.length; i++) {
            int mix = Integer.MAX_VALUE;
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[j] < arr[i]) {
                    mix = arr[j];
                    break;
                }
            }

            if (mix != Integer.MAX_VALUE) {
                arr[i] += mix;
            }
        }
        int[] copy = Arrays.copyOfRange(arr, 0, split.length);
        StringBuilder sb = new StringBuilder();
        for (int i : copy) {
            sb.append(i).append(" ");
        }
        System.out.println(sb.toString().trim());

    }
}
